<?php

namespace app\admin\validate;

use app\common\enums\StatusEnum;
use app\admin\model\LangClassFile AS FileModel;
use app\admin\model\LangClassRecite AS ReciteModel;
use think\Validate;

class LangClassRecite extends Validate
{
    protected $rule = [
        'word|单词或句子' => 'require|length:1,255',
        'class_id' => 'require|number',
        'course_type' => 'require|number|in:' . FileModel::COURSE_VOICE . ',' . FileModel::COURSE_BASE . ',' . FileModel::COURSE_SENIOR,
        'type' => 'require|number|in:' . ReciteModel::TYPE_WORD . ',' . ReciteModel::TYPE_SENTENCE,
        'type_id|分类' => 'require',
        'sort_num|权重' => 'require|number',
        'status' => 'in:' . StatusEnum::DISABLED . ',' . StatusEnum::ENABLED,
        'is_right|正确答案' => 'require'
    ];
}